package com.servlets;

import com.alibaba.fastjson.JSON;
import com.pojo.CarouselFigure;
import com.pojo.OrderProduct;
import com.pojo.PageBean;
import com.service.OrderProductService;
import com.service.impl.OrderProductServiceImpl;
import com.utils.JDBCUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/orderProduct.do")
public class OrderProductServlet extends BaseServlet{
    private OrderProductService service = new OrderProductServiceImpl();

    public void rank(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        List<OrderProduct> list = service.rank();
        response.setContentType("application/json;charset=utf-8");
        response.getWriter().write(JSON.toJSONString(list));
    }

}
